<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
    <style>
        body {
            background-color: rgb(184, 230, 248);
        }

        #app {
            width: 50%;
            margin: 50px auto;
            background-color: rgb(148, 220, 248);
            border: 5px solid blueviolet;
            border-radius: 1em;
            box-shadow: 3px 3px 3px rgba(187, 114, 230, 0.5);
        }
        h3 {
            text-align: center;
        }
        .title {
            width:100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border: 2px solid rgb(190, 136, 240);
            border-radius: 1em;

        }
        .title h4 {
            line-height: 5;
        }

    </style>
</head>
<body>
    <div id="app">
        <h3>我爱的古诗词</h3>
        <div>
            <div>
                <div class="title">
                    <h4>晚春归山居 </h4>
                    <span @click='click1()'>{{isOK?'收起':'展开'}}</span>
                </div>
                <div v-show='isOK'>
                    <p>溪上残春黄鸟稀，辛夷花尽杏花飞</p>
                    <p>始怜幽竹山窗下，不改清阴待我归</p>
                </div>
            </div>
        </div>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data() {
                return {
                    isOK: false
                }
            },
            methods: {
                click1() {
                    this.isOK = !this.isOK
                }
            }
        })
    </script>
</body>
</html>